Spinal cord data
Contents
Spinal cord data#
Spinal cord CSA#
Code imports#
# Python imports
from IPython.display import clear_output
from pathlib import Path
import numpy as np
import pandas as pd
# Import custom tools
from tools.data import Data
from tools.plot import Plot
Download data#
data_type = 'spine'
release_version = 'latest'
dataset = Data(data_type)
dataset.download(release_version)
--2022-06-14 03:18:18-- https://github.com/courtois-neuromod/anat-processing/releases/download//r20210610/spinalcord_results.zip
Resolving github.com (github.com)... 192.30.255.113
Connecting to github.com (github.com)|192.30.255.113|:443... connected.
HTTP request sent, awaiting response...
Archive: spinalcord_results.zip
inflating: data/spine/DWI_RD.csv
inflating: data/spine/DWI_FA.csv
inflating: data/spine/csa-SC_T2w.csv
inflating: data/spine/DWI_MD.csv
inflating: data/spine/MTR.csv
inflating: data/spine/MTsat.csv
inflating: data/spine/csa-GM_T2s.csv
inflating: data/spine/csa-SC_T1w.csv
inflating: data/spine/._csa-SC_T1w.csv
inflating: data/spine/T1.csv
302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/333825187/9e444c00-c9e2-11eb-880c-f9aa2a43f100?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220614%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220614T031818Z&X-Amz-Expires=300&X-Amz-Signature=79a0e7c9f7cd7f580252ea19fd6c4bc8f7ec1725eab6ee6bc64e5954b86c140a&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=333825187&response-content-disposition=attachment%3B%20filename%3Dspinalcord_results.zip&response-content-type=application%2Foctet-stream [following]
--2022-06-14 03:18:19-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/333825187/9e444c00-c9e2-11eb-880c-f9aa2a43f100?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220614%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220614T031818Z&X-Amz-Expires=300&X-Amz-Signature=79a0e7c9f7cd7f580252ea19fd6c4bc8f7ec1725eab6ee6bc64e5954b86c140a&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=333825187&response-content-disposition=attachment%3B%20filename%3Dspinalcord_results.zip&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 19324 (19K) [application/octet-stream]
Saving to: ‘spinalcord_results.zip’
0K .......... ........ 100% 32.5M=0.001s
2022-06-14 03:18:19 (32.5 MB/s) - ‘spinalcord_results.zip’ saved [19324/19324]
Load data plot it#
dataset.load()
fig_spine = Plot(dataset, plot_name = 'spine-1')
fig_spine.title = 'Spinal cord CSA [T<sub>1</sub>w/T<sub>2</sub>w]'
# If you're running this notebook in a Jupyter Notebook (eg, on MyBinder), change 'jupyter-book' to 'notebook'
fig_spine.display('jupyter-book', tissue = 'WM')
Gray matter CSA#
fig_spine = Plot(dataset, plot_name = 'spine-2')
fig_spine.title = 'Spinal cord gray matter CSA'
# If you're running this notebook in a Jupyter Notebook (eg, on MyBinder), change 'jupyter-book' to 'notebook'
fig_spine.display('jupyter-book', tissue = 'GM')
White matter qMRI#
data_type = 'qmri'
release_version = 'latest'
dataset = Data(data_type)
dataset.download(release_version)
--2022-06-14 03:18:20-- https://github.com/courtois-neuromod/anat-processing/releases/download//r20210610/spinalcord_results.zip
Resolving github.com (github.com)... 192.30.255.113
Connecting to github.com (github.com)|192.30.255.113|:443... connected.
HTTP request sent, awaiting response...
Archive: spinalcord_results.zip
inflating: data/qmri/DWI_RD.csv
inflating: data/qmri/DWI_FA.csv
inflating: data/qmri/csa-SC_T2w.csv
inflating: data/qmri/DWI_MD.csv
inflating: data/qmri/MTR.csv
inflating: data/qmri/MTsat.csv
inflating: data/qmri/csa-GM_T2s.csv
inflating: data/qmri/csa-SC_T1w.csv
inflating: data/qmri/._csa-SC_T1w.csv
inflating: data/qmri/T1.csv
302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/333825187/9e444c00-c9e2-11eb-880c-f9aa2a43f100?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220614%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220614T031818Z&X-Amz-Expires=300&X-Amz-Signature=79a0e7c9f7cd7f580252ea19fd6c4bc8f7ec1725eab6ee6bc64e5954b86c140a&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=333825187&response-content-disposition=attachment%3B%20filename%3Dspinalcord_results.zip&response-content-type=application%2Foctet-stream [following]
--2022-06-14 03:18:20-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/333825187/9e444c00-c9e2-11eb-880c-f9aa2a43f100?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220614%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220614T031818Z&X-Amz-Expires=300&X-Amz-Signature=79a0e7c9f7cd7f580252ea19fd6c4bc8f7ec1725eab6ee6bc64e5954b86c140a&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=333825187&response-content-disposition=attachment%3B%20filename%3Dspinalcord_results.zip&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 19324 (19K) [application/octet-stream]
Saving to: ‘spinalcord_results.zip’
0K .......... ........ 100% 8.78M=0.002s
2022-06-14 03:18:20 (8.78 MB/s) - ‘spinalcord_results.zip’ saved [19324/19324]
dataset.load()
fig_spine = Plot(dataset, plot_name = 'spine-3')
fig_spine.title = 'Spinal cord qMRI microstructure'
matrix = dataset.extract_data('qmri')
# If you're running this notebook in a Jupyter Notebook (eg, on MyBinder), change 'jupyter-book' to 'notebook'
fig_spine.display('jupyter-book', tissue = 'WM')